home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / ArchiveUtils / PackageInspector-0.96 / Source / PackageInspector.h < prev    next >
Text File  |  1995-08-17  |  4KB  |  121 lines

  1. /*+++*
  2.  *  title:    PackageInspector.h
  3.  *  abstract:    interface definitions for WM PackageInspector 
  4.  *  author:    T.R.Hageman, Groningen, The Netherlands
  5.  *  created:    November 1994
  6.  *  modified:    (see RCS Log at end)
  7.  *  copyleft:
  8.  *
  9.  *        Copyright (C) 1994,1995  Tom R. Hageman.
  10.  *
  11.  *    This is free software; you can redistribute it and/or modify
  12.  *    it under the terms of the GNU General Public License as published by
  13.  *    the Free Software Foundation; either version 2 of the License, or
  14.  *    (at your option) any later version.
  15.  *
  16.  *    This software is distributed in the hope that it will be useful,
  17.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  *    GNU General Public License for more details.
  20.  *
  21.  *    You should have received a copy of the GNU General Public License
  22.  *    along with this software; if not, write to the Free Software
  23.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  *
  25.  *  description:
  26.  *
  27.  *---*/
  28.  
  29. #import <appkit/appkit.h>
  30. #import <apps/Workspace.h>
  31.  
  32. #include <sys/stat.h>
  33.  
  34. #import "Subprocess.h"
  35.  
  36. #define NUMSTATS    4
  37. #define TYPESTOSTAT    "bom", "info", "sizes", "tiff"
  38.  
  39. @interface PackageInspector:WMInspector
  40. {
  41.     // Outlets
  42.     id    packageArchesField;
  43.     id    packageDescriptionText;
  44.     id    packageIconButton;
  45.     id    packageLocationField;
  46.     id    packageSizesField;
  47.     id    packageStatusField;
  48.     id    packageTitleField;
  49.     id    packageVersionField;
  50.  
  51.     id  inspectorVersionField;
  52.     id    infoPanel;
  53.     id    infoVersionField;
  54.  
  55.     // other variables.
  56.     NXBundle *bundle;        // class bundle.
  57.     NXBundle *package;        // package bundle.
  58.     struct stat stats[NUMSTATS];    // for lazy inspection.
  59.     enum { listContents, listDescription } revertButtonState;
  60.  
  61.     Subprocess *archProcess;    // To determine architectures.
  62. }
  63.  
  64. // Actions.
  65. -showInfo:sender;
  66.  
  67. -open:sender;
  68.  
  69. // The workhorses
  70. -(BOOL)shouldLoad;
  71. -load;
  72. -toggleDescription;
  73.  
  74. // Load helper methods
  75. -loadKeyValuesFrom:(const char *)type inTable:(HashTable *)table;
  76. -loadContentsOf:(const char *)type inTable:(HashTable *)table;
  77. -loadImage;
  78.  
  79. // Support methods
  80. -(const char *)getPath:(char *)path forType:(const char *)type;
  81. -setRevertButtonTitle;
  82. -(const char *)formatSize:(const char *)size inBuf:(char *)buf;
  83.  
  84. // Determine architectures, in separate subprocess.
  85. -(void)getArchs;
  86. // Subprocess [TRH-enhanced] delegate methods:
  87. // Subprocess delegate methods:
  88. -subprocess:(Subprocess *)sender output:(char *)buffer;
  89. -subprocessDone:(Subprocess *)sender;
  90.  
  91. @end // PackageInspector
  92.  
  93. /*======================================================================
  94.  * PackageInspector.h,v
  95.  * Revision 1.7  1995/08/17 22:18:24  tom
  96.  * (-open:): new method.
  97.  *
  98.  * Revision 1.6  1995/07/30 16:59:51  tom
  99.  * import Subprocess.h; (archProcess): new ivar;
  100.  * (-getArchs,-subprocess:output:,-subprocessDone:): new methods;
  101.  * added for asynchronous arch-determination.
  102.  *
  103.  * Revision 1.5  1995/07/29 02:59:55  tom
  104.  * (NUMSTATS,TYPESTOSTAT): new defines, (stats[NUMSTATS]): new ivar, replaces
  105.  * bomstat, infostat, t ogeneralize lazy-load code.
  106.  *
  107.  * Revision 1.4  1995/04/02  02:39:05  tom
  108.  * (package): NXBundle instead of (const char *). so that localized info files
  109.  *  are found. (this loses out if *.pkg is a symbolic link, though.)
  110.  *
  111.  * Revision 1.3  1994/12/07  00:00:36  tom
  112.  * add GNU copleft comment.
  113.  *
  114.  * Revision 1.2  1994/11/25  20:18:56  tom
  115.  * (package ivar): use (char*) instead of (NXBundle*) to workaround symlink problems
  116.  *
  117.  * Revision 1.1  1994/11/24  22:39:56  tom
  118.  * Initial revision
  119.  *
  120.  *======================================================================*/
  121.